Declarations ​
function FastFloor(Value: TFloat): Integer; overload;
function FastFloor(Value: Double): Integer; overload;
function FastCeil(Value: TFloat): Integer; overload;
function FastCeil(Value: Double): Integer; overload;
function FastTrunc(Value: TFloat): Integer;
function FastRound(Value: TFloat): Integer;
function FastFloorSingle(Value: TFloat): Integer;
function FastFloorDouble(Value: Double): Integer;
function FastCeilSingle(Value: TFloat): Integer;
function FastCeilDouble(Value: Double): Integer;Overload Details
Overload 1 ​
function FastFloor(Value: TFloat): Integer; overload;Computes the greatest integer less than or equal to Value (Single precision).
| Parameter | Type | Description |
|---|---|---|
Value | TFloat | Floating-point single value. |
| Type | Description |
|---|---|
Integer | Floor of Value as an Integer. |
Overload 2 ​
function FastFloor(Value: Double): Integer; overload;Computes the greatest integer less than or equal to Value (Double precision).
| Parameter | Type | Description |
|---|---|---|
Value | Double | Floating-point double value. |
| Type | Description |
|---|---|
Integer | Floor of Value as an Integer. |
Overload 3 ​
function FastCeil(Value: TFloat): Integer; overload;Computes the smallest integer greater than or equal to Value (Single precision).
| Parameter | Type | Description |
|---|---|---|
Value | TFloat | Floating-point single value. |
| Type | Description |
|---|---|
Integer | Ceil of Value as an Integer. |
Overload 4 ​
function FastCeil(Value: Double): Integer; overload;Computes the smallest integer greater than or equal to Value (Double precision).
| Parameter | Type | Description |
|---|---|---|
Value | Double | Ceil of Value as an Integer. |
Overload 5 ​
function FastTrunc(Value: TFloat): Integer;Truncates floating-point Value to Integer towards zero.
| Parameter | Type | Description |
|---|---|---|
Value | TFloat | Floating-point value. |
| Type | Description |
|---|---|
Integer | Truncated integer. |
Overload 6 ​
function FastRound(Value: TFloat): Integer;Rounds floating-point Value to the nearest Integer.
| Parameter | Type | Description |
|---|---|---|
Value | TFloat | Floating-point value. |
| Type | Description |
|---|---|
Integer | Nearest integer value. |
Overload 7 ​
function FastFloorSingle(Value: TFloat): Integer;Fast floor operation for Single precision.
| Parameter | Type | Description |
|---|---|---|
Value | TFloat | Single-precision float value. |
| Type | Description |
|---|---|
Integer | Floor integer. |
Overload 8 ​
function FastFloorDouble(Value: Double): Integer;Fast floor operation for Double precision.
| Parameter | Type | Description |
|---|---|---|
Value | Double | Double-precision float value. |
| Type | Description |
|---|---|
Integer | Floor integer. |
Overload 9 ​
function FastCeilSingle(Value: TFloat): Integer;Fast ceiling operation for Single precision.
| Parameter | Type | Description |
|---|---|---|
Value | TFloat | Single-precision float value. |
| Type | Description |
|---|---|
Integer | Ceil integer. |
Overload 10 ​
function FastCeilDouble(Value: Double): Integer;Fast ceiling operation for Double precision.
| Parameter | Type | Description |
|---|---|---|
Value | Double | Double-precision float value. |
| Type | Description |
|---|---|
Integer | Ceil integer. |
Description ​
The fast rounding routines (FastFloor, FastCeil, FastTrunc, FastRound, FastFloorSingle, FastFloorDouble, FastCeilSingle, FastCeilDouble) provide optimized replacements for standard Pascal Runtime Library (RTL) floating-point conversion routines.
When CPU instruction set extensions are available at runtime (such as SSE2 or SSE4.1), Graphics32 binds the rounding function delegates (FastTrunc, FastRound, FastFloorSingle, FastFloorDouble, FastCeilSingle, FastCeilDouble) to specialized hardware-accelerated SIMD implementations.